<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/include/page.jsp"%>
<c:set value="${requestScope.response.data.pageInfoUtil }" var="pageInfoUtil"/>
<c:set value="${requestScope.response.data.list }" var="list"/>
<jsp:useBean id="pojo" class="com.wang.users.pojo.ABodyside"/>
<!DOCTYPE html>
<html lang="zh-CN">
	<head>
		<title>体测成绩列表 - 体能测试系统</title>
		<%@ include file="/head/common/include/title.jsp"%>
		<script type="text/javascript" src="${rootPath }/common/resource/My97DatePicker/WdatePicker.js"></script>
		<script src="${rootPath }/common/resource/Highcharts/code/highcharts.js"></script>
		<script src="${rootPath }/common/resource/Highcharts/code/modules/series-label.js"></script>
		<script src="${rootPath }/common/resource/Highcharts/code/modules/exporting.js"></script>
		<script src="${rootPath }/common/resource/Highcharts/code/modules/export-data.js"></script>
		<script src="${rootPath }/common/resource/Highcharts/code/modules/accessibility.js"></script>
	</head>
	<body>
		<%@ include file="/head/common/include/header.jsp"%>
		<!-- 网页的主体部分 -->
		<div class="container">
			<div class="row">
				<div class="col-md-11 col-sm-offset-1">
					<h2 class="sub-header">体测成绩列表</h2>
	
					<form action="${rootPath }/head/bodys/sidesList" method="post" class="form-inline">
						<label for="keyword">关键字:</label>
						<input type="text" name="keyword" value="${requestScope.keyword }" class="form-control mr-sm-2">
						<%-- <label for="status">用户状态:</label>
						<select name="claStatus" class="form-control mr-sm-2">
							<option value="">请选择</option>
							<c:forEach items="${pojo.enumsMap }" var="me" varStatus="stat">
								<c:if test="${fn:startsWith(me.key,'ClASTATUS')}">
									<!-- 拆分,按照-拆分,取最后一个 -->
									<c:set value="${fn:split(me.key, '-')}" var="keys"/>
									<option value="${keys[1] }" ${requestScope.claStatus == keys[1] ? 'selected' : '' }>${me.value }</option>
								</c:if>
							</c:forEach>
						</select> --%>
						<label for="pubTime">发布时间:</label>
						<input type="text" name="st" value="${requestScope.st }" readonly="true" class="form-control mr-sm-2" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate"/>
						-->
						<input type="text" name="ed" value="${requestScope.ed }" readonly="true" class="form-control mr-sm-2" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" class="Wdate"/>
						<input type="submit" class="btn btn-primary" value="搜索">
					</form>
					<a  class="btn btn-primary" href="${rootPath }/head/bodys/sidesInsert?email=${sessionScope.usersSess.email}" target="_blank">添加成绩</a>
					<div class="form-group">
						<div class="col-sm-8 col-sm-offset-2">
							<!-- <button class="btn btn-lg btn-primary" type="submit">添加评论</button> -->
							<a onclick="return $('#report').toggle();" class="btn btn-primary">查看数据分析视图</a>
						</div>
					</div>
					<div class="form-group" id="report" style="display: none;">
					
				</div>
				</div>
				<div class="col-md-11 col-sm-offset-1">
					<div class="table-responsive mt-2">
						<table class="table table-striped table-hover">
							<thead>
								<tr>
									<th>序号</th>
									<th>用户邮箱</th>
									<th title="成绩参照">成绩参照</th>
									<th >身高</th>
									<th>体重</th>
									<th >体脂</th>
									<th >肺活量</th>
									<th >长跑</th>
									<th>健康指数</th>
									<th>状态</th>
									<th >创建时间</th>
									<th>操作</th>
								</tr>
							</thead>
							<tbody>
								<c:forEach items="${list }" var="listTemp" varStatus="stat">
									<tr>
										<td>${stat.count }</td>
										<td>
											<a title="查看用户信息" href="${rootPath }/head/users/usersUpdate?id=${listTemp.users.id}" target="_blank">${listTemp.users.email }</a>
										</td>
										<td>
											<a title="查看标准信息" href="${rootPath }/head/bodys/standsUpdate?id=${listTemp.stand.id}" target="_blank">${listTemp.stand.grade }(${listTemp.stand.sexStr })</a>
										</td>
										<td>
											<a title="查看详情" href="${rootPath }/head/bodys/sidesUpdate?id=${listTemp.list.id}" target="_blank">${listTemp.height }</a>
										</td>
										<td>${listTemp.weight }</td>
										<td>${listTemp.bml }</td>
										<td>${listTemp.vitalcapacity }</td>
										<td>${listTemp.longrun }</td>
										<td>${listTemp.healthIndex }</td>
										<td>${listTemp.statusStr }</td>
										<td>${listTemp.createTime }</td>
										<td>
											<a href="${rootPath }/head/bodys/sidesUpdate?operType=update&id=${listTemp.id}" target="_blank" class="btn btn-primary">
												更新
											</a>
										</td>
									</tr>
								</c:forEach>							
							</tbody>
						</table>
					</div>
				</div>
				<div class="col-md-11 col-sm-offset-1">
					<form id="pageForm" action="${rootPath }/head/bodys/sidesList"
						method="post" class="form-inline col-md-11 col-sm-offset-1">
						<!-- 设置一些参数 -->
						<input type="hidden" name="keyword" value="${requestScope.keyword }">
						<input type="hidden" name="status" value="${requestScope.status }">
						<input type="hidden" name="claStatus" value="${requestScope.claStatus }">
						<input type="hidden" name="st" value="${requestScope.st }">
						<input type="hidden" name="ed" value="${requestScope.ed }">

						<input type="hidden" name="classId" value="${param.classId}"/>
	
						<nav aria-label="Page navigation example">
							<ul class="pagination justify-content-end">
								<li class="page-item">
									<a href="#" class="page-link" onclick="return pageFormSubmit('pageForm', 'currentPage', '1', 'pageSize','${pageInfoUtil.pageSize}')">
										<span>首页</span>
									</a>
								</li>
								<li class="page-item">
									<a href="#" class="page-link" onclick="return pageFormSubmit('pageForm', 'currentPage', '${pageInfoUtil.prePage}', 'pageSize','${pageInfoUtil.pageSize}')">
										<span>上一页</span>
									</a>
								</li>
								<li class="page-item">
									<a href="#" class="page-link" onclick="return pageFormSubmit('pageForm', 'currentPage', '${pageInfoUtil.nextPage}', 'pageSize','${pageInfoUtil.pageSize}')">
										<span>下一页</span>
									</a>
								</li>
								<li class="page-item">
									<a href="#" class="page-link" onclick="return pageFormSubmit('pageForm', 'currentPage', '${pageInfoUtil.totalPage}', 'pageSize','${pageInfoUtil.pageSize}')">
										<span>尾页</span>
									</a>
								</li>
								<li class="page-item">共${pageInfoUtil.totalRecord }条,共${pageInfoUtil.totalPage}页</li>
								<li class="page-item">
									第<input type="text" id="currentPage" name="currentPage" class="form-control" value="${pageInfoUtil.currentPage }"  size="5" maxlength="5"/>页
								</li>
								<li class="page-item">
									<input type="text" id="pageSize" name="pageSize" class="form-control" value="${pageInfoUtil.pageSize }" size="5" maxlength="5"/>
								</li>
								<li class="page-item"><input type="submit" value="GO" class="form-control btn btn-primary"/></li>
							</ul>
						</nav>
					</form>
				</div>
			</div>
		</div>
		<%@ include file="/head/common/include/footer.jsp"%>
		
		<script type="text/javascript">
			Highcharts.chart('report', {
		
			    title: {
			        text: '数据可视化分析图'
			    },
		
			    subtitle: {
			        text: '体能测试系统'
			    },
		
			    yAxis: {
			        title: {
			            text: '指数'
			        }
			    },
		
			    xAxis: {
			    	categories: 
		        	[
						<c:forEach items="${list }" var="listTemp" varStatus="stat">
							"${listTemp.createTime}"
							${stat.last ? '' : ',' }
						</c:forEach>	
					]
			    },
		
			    legend: {
			        layout: 'vertical',
			        align: 'right',
			        verticalAlign: 'middle'
			    },
			    
			    series: [
			    	{
				        name: '健康指数',
				        data: [
							<c:forEach items="${list }" var="listTemp" varStatus="stat">
							${listTemp.healthIndex},
							</c:forEach>	
							]
				   	 },
			    	{
			        name: 'BMI',
			        data: [
						<c:forEach items="${list }" var="listTemp" varStatus="stat">
						${listTemp.bmlFraction},
						</c:forEach>	
						]
			   	 },
			    	{
			        name: '肺活量',
			        data: [
						<c:forEach items="${list }" var="listTemp" varStatus="stat">
						${listTemp.vitalcapacityFraction},
						</c:forEach>	
						]
			    }, {
			        name: '800米/1000米跑',
			        data: [
						<c:forEach items="${list }" var="listTemp" varStatus="stat">
						${listTemp.longrunFraction},
						</c:forEach>	
						]
			    }, {
			        name: '50米跑',
			        data: [
						<c:forEach items="${list }" var="listTemp" varStatus="stat">
						${listTemp.shortrunFraction},
						</c:forEach>	
						]
			    }, {
			        name: '仰卧起坐/引体向上',
			        data: [
						<c:forEach items="${list }" var="listTemp" varStatus="stat">
						${listTemp.abdominalcurlFraction},
						</c:forEach>	
						]
			    }, {
			        name: '坐位体前屈',
			        data: [
						<c:forEach items="${list }" var="listTemp" varStatus="stat">
						${listTemp.sittingforwardFraction},
						</c:forEach>	
						]
			    }],
			    responsive: {
			        rules: [{
			            condition: {
			                maxWidth: 500
			            },
			            chartOptions: {
			                legend: {
			                    layout: 'horizontal',
			                    align: 'center',
			                    verticalAlign: 'bottom'
			                }
			            }
			        }]
			    }
		
			});
		</script>
	</body>
</html>